package com.szbmyoubao.app.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import com.szbmyoubao.app.bean.ToolsItem
import com.ellecity06.common.base.BaseAdapter
import com.ellecity06.cwhiskymall.databinding.ItemToolsBinding

/**
 * @author zavier
 * @time 2025/3/5 19:05
 * @des
 */
class ToolsAdapter : BaseAdapter<ToolsItem.ToolsChildItem, ItemToolsBinding>() {
    override fun inflateBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): ItemToolsBinding {
        return ItemToolsBinding.inflate(layoutInflater, parent, false)
    }

    override fun convert(
        binding: ItemToolsBinding,
        position: Int,
        item: ToolsItem.ToolsChildItem
    ) {
        binding.name.text = item.name
        binding.icon.setImageResource(item.icon)
    }
}